package com.ls.pattern.mediator;

/**
 * @author 挥之以墨
 */
public class User {
    private String name;
    private ChatMediator chatMediator;

    public User(String name, ChatMediator chatMediator) {
        this.name = name;
        this.chatMediator = chatMediator;
    }

    public void sendMsg(String msg) {
        this.chatMediator.sendMsg2Room(this, msg);
    }

    public String getName() {
        return name;
    }
}
